<%@page import="java.sql.*"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
删除记录：
<% 
String url="jdbc:mysql://localhost:3306/db?serverTimezone=PRC&allowMultiQueries=true";
//(1)加载驱动
Class.forName("com.mysql.cj.jdbc.Driver");
//(2)创建数据库连接
Connection cn = DriverManager.getConnection(url,"root","12qwas");
//(3)创建预处理语句对象以执行sql指令
PreparedStatement ps = cn.prepareStatement("delete from chengyu where cy like '一鳞%'; delete from chengyu where cy like '一龙%'");
int count=ps.executeUpdate();
out.print(count);
out.println("getMoreResults: "+ps.getMoreResults());
out.println("getUpdateCount: "+ps.getUpdateCount());
ps.close();
cn.close();
%>

</body>
</html>